package com.freewater.springboot.demo.aop.advice.afterthrow;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        applicationContext.registerShutdownHook();
        final PersonService personService = applicationContext.getBean(PersonService.class);
        final Person person = personService.addPerson(null, 10); // 传入null，促使抛出异常
        personService.addPerson(person); // 不会被拦截
    }
}
